import 'package:flutter_test/flutter_test.dart';
import 'package:map_search/map_search.dart';
import 'package:map_search/map_search_platform_interface.dart';
import 'package:map_search/map_search_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockMapSearchPlatform
    with MockPlatformInterfaceMixin
    implements MapSearchPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');

  @override
  Future<String?> getTest() => Future.value('test');
}

void main() {
  final MapSearchPlatform initialPlatform = MapSearchPlatform.instance;

  test('$MethodChannelMapSearch is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelMapSearch>());
  });

  test('getPlatformVersion', () async {
    MapSearch mapSearchPlugin = MapSearch();
    MockMapSearchPlatform fakePlatform = MockMapSearchPlatform();
    MapSearchPlatform.instance = fakePlatform;

    expect(await mapSearchPlugin.getPlatformVersion(), '42');

    expect(await mapSearchPlugin.getTest(), 'test');
  });
}
